﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class VoteMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.Vote>
    {
        public VoteMap()
        {
            // table
            //ToTable("CMS_Vote");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.Title)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Pass)
                
                .IsRequired();
            Property(t => t.VoteType)
                
                .IsRequired();
            Property(t => t.PicUrl)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.EndData)
                
                .IsOptional();
            Property(t => t.Windowsize)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.TemplateFileName)
                
                .HasMaxLength(255)
                .IsRequired();
            Property(t => t.LimitIP)
                
                .IsRequired();
            Property(t => t.CheckInTime)
                
                .IsRequired();

            // Relationships
          

            //InitializeMapping();
        }
    }
}

